//
// Created by lyc on 2025/3/24.
//

#ifndef LAB2_GENERATEANDREADDATA_H
#define LAB2_GENERATEANDREADDATA_H




#endif //LAB2_GENERATEANDREADDATA_H


#include "knapsack01.h"


#include <iostream>
#include <fstream>
#include <vector>
#include <random>
#include <iomanip> // 用于设置输出精度
#include <sstream>
#include <chrono>
void generateAndSaveData(const string& filename, int numItems, int maxWeight, int maxCapacity);
bool readData(const string& filename, double& capacity, vector<Item>& items);